package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.pojo.DtsUser;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author zhaojian
 * @since 2021-05-12
 */
public interface DtsUserMapper extends BaseMapper<DtsUser> {

    @Select("SELECT DISTINCT u.* " +
            "from dts_order o  " +
            "LEFT JOIN dts_order_goods og " +
            "on o.id=og.order_id " +
            "LEFT JOIN dts_user u " +
            "on o.user_id=u.id " +
            "WHERE o.deleted=0 " +
            "GROUP BY u.nickname ")
    List<DtsUser> listUser();
}
